<?
require_once('./lib/Config.php');
require_once('./lib/DB.gear.php');
require_once('./lib/Template.gear.php');
require_once('./lib/lib.gear.php');
require_once('./lib/lib.garden.php');

if(isset($_POST['g_key_din39s03j23ogn']) && $_POST['g_key_din39s03j23ogn'] == G_KEY)
{
    $user_id = $_POST['user_id'];

    $db = new DB_GEAR();

    //set query
    $aQuery['Type']   = 'direct';
    $aQuery['Query']  = 'select user.* from garden_user_tbl as user inner join garden_mixi_tbl as mixi on user.user_id = mixi.using_flag where mixi.user_id = '.$user_id;

    //set query
    $db->set_query($aQuery);
    //echo $db->get_query();
    //send query
    $result = $db->send_query();
    
	if(mysql_num_rows($result))
	{
		while($rec = mysql_fetch_array($result,MYSQL_ASSOC))
		{
			$aList[] = $rec;
		}
	}
	else
	{
	    $data = array(
	                   'status'  => 'error',
	                  );
	    $json_data = json_encode($data);
	}

    $json_data = json_encode($aList);

    echo $json_data;
    //preDump(json_decode($json_data));

}
else
{
    $data = array(
                   'status'  => 'error',
                  );
    $json_data = json_encode($data);
}

?>
